home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume1 / xfig / patch4 < prev    next >
Encoding:
Text File  |  1988-08-30  |  42.4 KB  |  1,639 lines

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v01i017:  xfig: a MacDraw like graphics editor, Patch4
  5. Message-ID: <1668@wyse.wyse.com>
  6. Date: 30 Aug 88 17:24:16 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 1628
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: dana@thumper.bellcore.com (Dana A. Chee)
  12. Posting-number: Volume 1, Issue 17
  13. Archive-name: xfig/patch4
  14.  
  15.  
  16.  
  17.  
  18. Below are the patches which incorportate the changes that John Kohl
  19. announced in comp.windows.x.  This is patch 4 (in keeping with expo)
  20. and is being submitted to comp.sources.x and stored on expo.
  21.  
  22. It should create a patch file (since I didn't have one).  The reason
  23. it is patchlevel 3 is to stay in line with the minor version number
  24. (which is now 3).
  25.  
  26.             Dana Chee
  27.             Bellcore
  28.             MRE 2Q-250
  29.             (201) 829-4488
  30.             dana@bellcore.com
  31. ==================== xfig.patch.4
  32. diff -c /dev/null patchlevel.h
  33. *** /dev/null    Fri Aug 26 09:30:01 1988
  34. --- patchlevel.h    Fri Aug 26 09:06:45 1988
  35. ***************
  36. *** 0 ****
  37. --- 1 ----
  38. + #define PATCHLEVEL 3
  39. diff -c README.X11.orig README.X11
  40. *** README.X11.orig    Fri Aug 12 22:30:14 1988
  41. --- README.X11    Fri Aug 26 10:28:14 1988
  42. ***************
  43. *** 61,63 ****
  44. --- 61,78 ----
  45.           Dana Chee of Bellcore contributed lots of cleanups
  46.           and put right some features I didn't know how
  47.           to do properly. (Thanks, Dana.) Released to world.
  48. + xfig 1.4.2:
  49. + 23 Aug 88     Dana Chee (Bellcore)
  50. +           Fixed color, added mouse tracking option.
  51. + xfig 1.4.3:
  52. + 26 Aug 88     Dana Chee (Bellcore)
  53. +           Added John Kohl's changes to fix color and make
  54. +           inverse video work on a monochrome display.
  55. +           Allow scaling of compound objects on a side as well as
  56. +           a corner.
  57. +           Allow compound objects within a compound.
  58. diff -c /tmp/panel.c panel.c
  59. *** /tmp/panel.c    Fri Aug 26 09:38:46 1988
  60. --- panel.c    Thu Aug 25 11:25:16 1988
  61. ***************
  62. *** 132,138 ****
  63. --- 132,144 ----
  64.       { XtNheight, (XtArgVal)0 },
  65.       { XtNhSpace, (XtArgVal)SWITCH_ICON_SPACING },
  66.       { XtNvSpace, (XtArgVal)SWITCH_ICON_SPACING },
  67. +     /* Fix the size of the panel window by chaining both top & bottom
  68. +        to the top, and both left & right to the right */
  69. +     { XtNtop, (XtArgVal)XtChainTop},
  70. +     { XtNbottom, (XtArgVal)XtChainTop},
  71.       { XtNleft, (XtArgVal)XtChainLeft },
  72. +     { XtNright, (XtArgVal)XtChainLeft },
  73. +     { XtNresizable, (XtArgVal) FALSE },
  74.   };
  75.   
  76.   extern void button_select();
  77. ***************
  78. *** 152,157 ****
  79. --- 158,164 ----
  80.       { XtNheight, (XtArgVal)0 },
  81.       { XtNbackgroundPixmap, (XtArgVal)NULL },
  82.       { XtNcallback, (XtArgVal)button_callbacks },
  83. +     { XtNresizable, (XtArgVal) FALSE },
  84.   };
  85.   
  86.   extern int    PANEL_LEFT, PANEL_TOP, PANEL_HEIGHT, PANEL_WID;
  87. ***************
  88. *** 206,212 ****
  89.       XSetForeground(d, cgc, fg);
  90.       XSetBackground(d, cgc, bg);
  91.       
  92. -     /*XCopyGC(d, gc, ~0, cgc);*/
  93.       for (i = 0; i < N_SWITCHES; ++i)
  94.       {
  95.           sw = &switches[i];
  96. --- 213,218 ----
  97. diff -c /tmp/ruler.c ruler.c
  98. *** /tmp/ruler.c    Fri Aug 26 09:38:50 1988
  99. --- ruler.c    Fri Aug 26 08:51:05 1988
  100. ***************
  101. *** 18,28 ****
  102. --- 18,36 ----
  103.   #define            QUARTER_MARK        8
  104.   #define            SIXTEENTH_MARK        6
  105.   
  106. + #ifndef    X11
  107.   #define            MARK_HT            5
  108.   #define            TRM_WID            15
  109.   #define            TRM_HT            8
  110.   #define            SRM_WID            8
  111.   #define            SRM_HT            15
  112. + #else
  113. + #define            MARK_HT            5
  114. + #define            TRM_WID            16
  115. + #define            TRM_HT            8
  116. + #define            SRM_WID            8
  117. + #define            SRM_HT            16
  118. + #endif
  119.   
  120.   extern int        CANVAS_HEIGHT, CANVAS_WIDTH;
  121.   extern int        SIDERULER_WIDTH, SIDERULER_HEIGHT;
  122. ***************
  123. *** 31,37 ****
  124.   extern int        TOPRULER_LEFT, TOPRULER_TOP;
  125.   extern            null_proc();
  126.   extern int        RHS_PANEL;
  127. ! extern int        tracking;
  128.   
  129.   static            lasty = -100;
  130.   static            lastx = -100;
  131. --- 39,45 ----
  132.   extern int        TOPRULER_LEFT, TOPRULER_TOP;
  133.   extern            null_proc();
  134.   extern int        RHS_PANEL;
  135. ! extern int        TRACKING;
  136.   
  137.   static            lasty = -100;
  138.   static            lastx = -100;
  139. ***************
  140. *** 39,44 ****
  141. --- 47,53 ----
  142.   static char        *number[] = {"0", "1", "2", "3", "4", "5", 
  143.                       "6", "7", "8", "9", "10", "11" };
  144.   static int        troffx = -7, troffy = -10;
  145. + #ifndef    X11
  146.   static short        tr_marker_image[8] = {
  147.                   0xFFFE,    /* *************** */
  148.                   0x7FFC,    /*  *************  */
  149. ***************
  150. *** 49,56 ****
  151. --- 58,78 ----
  152.                   0x0380,    /*       ***       */
  153.                   0x0100    /*        *        */
  154.                   };
  155. + #else
  156. + static char        tr_marker_image[16] = {
  157. +                 0xFF, 0xFE,    /* *************** */
  158. +                 0x7F, 0xFC,    /*  *************  */
  159. +                 0x3F, 0xF8,    /*   ***********   */
  160. +                 0x1F, 0xF0,    /*    *********    */
  161. +                 0x0F, 0xE0,    /*     *******     */
  162. +                 0x07, 0xC0,    /*      *****      */
  163. +                 0x03, 0x80,    /*       ***       */
  164. +                 0x01, 0x00    /*        *        */
  165. +                 };
  166. + #endif
  167.   static            mpr_static(trm_pr, TRM_WID, TRM_HT, 1, tr_marker_image);
  168.   static int        srroffx = 2, srroffy = -7;
  169. + #ifndef    X11
  170.   static short        srr_marker_image[15] = {
  171.                   0x0100,    /*          *  */
  172.                   0x0300,    /*         **  */
  173. ***************
  174. *** 68,80 ****
  175.                   0x0300,    /*         **  */
  176.                   0x0100    /*          *  */
  177.                   };
  178. - #ifndef    X11
  179. - static        mpr_static(srrm_pr, SRM_WID, SRM_HT, 1, srr_marker_image);
  180.   #else
  181. ! static        mpr_static(srrm_pr, 16, SRM_HT, 1, srr_marker_image);
  182.   #endif
  183.   
  184.   static int        srloffx = -10, srloffy = -7;
  185.   static short        srl_marker_image[15] = {
  186.                   0x8000,    /*  *          */
  187.                   0xC000,    /*  **         */
  188. --- 90,119 ----
  189.                   0x0300,    /*         **  */
  190.                   0x0100    /*          *  */
  191.                   };
  192.   #else
  193. ! static char        srr_marker_image[16] = {
  194. !                 0x01,    /*          *  */
  195. !                 0x03,    /*         **  */
  196. !                 0x07,    /*        ***  */
  197. !                 0x0F,    /*       ****  */
  198. !                 0x1F,    /*      *****  */
  199. !                 0x3F,    /*     ******  */
  200. !                 0x7F,    /*    *******  */
  201. !                 0xFF,    /*   ********  */
  202. !                 0x7F,    /*    *******  */
  203. !                 0x3F,    /*     ******  */
  204. !                 0x1F,    /*      *****  */
  205. !                 0x0F,    /*       ****  */
  206. !                 0x07,    /*        ***  */
  207. !                 0x03,    /*         **  */
  208. !                 0x01,    /*          *  */
  209. !                 0x00
  210. !                 };
  211.   #endif
  212. + static        mpr_static(srrm_pr, SRM_WID, SRM_HT, 1, srr_marker_image);
  213.   
  214.   static int        srloffx = -10, srloffy = -7;
  215. + #ifndef    X11
  216.   static short        srl_marker_image[15] = {
  217.                   0x8000,    /*  *          */
  218.                   0xC000,    /*  **         */
  219. ***************
  220. *** 92,102 ****
  221.                   0xC000,    /*  **         */
  222.                   0x8000    /*  *          */
  223.                   };
  224. - #ifndef    X11
  225. - static        mpr_static(srlm_pr, SRM_WID, SRM_HT, 1, srl_marker_image);
  226.   #else
  227. ! static        mpr_static(srlm_pr, 16, SRM_HT, 1, srl_marker_image);
  228.   #endif
  229.   
  230.   #ifdef    X11
  231.   static Pixmap        toparrow_pm, sidearrow_pm;
  232. --- 131,157 ----
  233.                   0xC000,    /*  **         */
  234.                   0x8000    /*  *          */
  235.                   };
  236.   #else
  237. ! static char        srl_marker_image[16] = {
  238. !                 0x80,    /*  *          */
  239. !                 0xC0,    /*  **         */
  240. !                 0xE0,    /*  ***        */
  241. !                 0xF0,    /*  ****       */
  242. !                 0xF8,    /*  *****      */
  243. !                 0xFC,    /*  ******     */
  244. !                 0xFE,    /*  *******    */
  245. !                 0xFF,    /*  ********   */
  246. !                 0xFE,    /*  *******    */
  247. !                 0xFC,    /*  ******     */
  248. !                 0xF8,    /*  *****      */
  249. !                 0xF0,    /*  ****       */
  250. !                 0xE0,    /*  ***        */
  251. !                 0xC0,    /*  **         */
  252. !                 0x80,    /*  *          */
  253. !                 0x00
  254. !                 };
  255.   #endif
  256. + static        mpr_static(srlm_pr, SRM_WID, SRM_HT, 1, srl_marker_image);
  257.   
  258.   #ifdef    X11
  259.   static Pixmap        toparrow_pm, sidearrow_pm;
  260. ***************
  261. *** 111,121 ****
  262.       pw_write(topruler_pixwin, x + troffx, RULER_WIDTH + troffy, 
  263.           TRM_WID, TRM_HT, INV_PAINT, &trm_pr, 0, 0);
  264.   #else
  265. !     XCopyArea(tool_d, toparrow_pm, topruler_pixwin, gccache[INV_PAINT],
  266.           0, 0, trm_pr.width, trm_pr.height,
  267. -         lastx + troffx, TOPRULER_HEIGHT + troffy);
  268. -     XCopyArea(tool_d, toparrow_pm, topruler_pixwin, gccache[INV_PAINT],
  269. -         0, 0, trm_pr.width, trm_pr.height,
  270.           x + troffx, TOPRULER_HEIGHT + troffy);
  271.   #endif    X11
  272.       lastx = x;
  273. --- 166,176 ----
  274.       pw_write(topruler_pixwin, x + troffx, RULER_WIDTH + troffy, 
  275.           TRM_WID, TRM_HT, INV_PAINT, &trm_pr, 0, 0);
  276.   #else
  277. !     XClearArea(tool_d, topruler_pixwin,lastx + troffx,
  278. !            TOPRULER_HEIGHT + troffy,trm_pr.width,
  279. !            trm_pr.height, False);
  280. !     XCopyArea(tool_d, toparrow_pm, topruler_pixwin, topgc,
  281.           0, 0, trm_pr.width, trm_pr.height,
  282.           x + troffx, TOPRULER_HEIGHT + troffy);
  283.   #endif    X11
  284.       lastx = x;
  285. ***************
  286. *** 181,186 ****
  287. --- 236,246 ----
  288.       { XtNhorizDistance, (XtArgVal)0 },
  289.       { XtNfromVert, (XtArgVal)NULL },
  290.       { XtNvertDistance, (XtArgVal)0 },
  291. +     { XtNresizable, (XtArgVal)FALSE },
  292. +     { XtNtop, (XtArgVal)XtRubber },
  293. +     { XtNbottom, (XtArgVal)XtRubber },
  294. +     { XtNleft, (XtArgVal)XtRubber },
  295. +     { XtNright, (XtArgVal)XtRubber },
  296.   };
  297.   
  298.   extern int    SIDERULER_WIDTH, SIDERULER_HEIGHT;
  299. ***************
  300. *** 193,203 ****
  301. --- 253,275 ----
  302.       ruler_args[3].value = SIDERULER_HEIGHT = CANVAS_HEIGHT;
  303.       ruler_args[5].value = (XtArgVal)canvas_sw;
  304.       ruler_args[7].value = (XtArgVal)topruler_sw;
  305. +     /* Place the sideruler below the topruler, next to the canvas,
  306. +        but fixed offset from the top of the form */
  307. +     ruler_args[10].value = (XtArgVal)XtChainTop;
  308. +     ruler_args[11].value = (XtArgVal)XtRubber;
  309. +     ruler_args[12].value = (XtArgVal)XtRubber;
  310. +     ruler_args[13].value = (XtArgVal)XtRubber;
  311. +     
  312.       sideruler_sw = XtCreateWidget("sruler", labelWidgetClass, tool,
  313.           ruler_args, XtNumber(ruler_args));
  314.       return(1);
  315.   }
  316.   
  317. + redisplay_sideruler()
  318. + {
  319. +     XClearWindow(tool_d, sideruler_pixwin);
  320. + }
  321.   setup_rulers()
  322.   {
  323.       register int        i, j;
  324. ***************
  325. *** 254,259 ****
  326. --- 326,350 ----
  327.       ruler_args[0].value = (XtArgVal)p;
  328.       XtSetValues(topruler_sw, ruler_args, 1);
  329.   
  330. +     /* The arrows will be XORed into the rulers.
  331. +        We want the foreground color in the arrow to result in
  332. +        the foreground or background color in the display.
  333. +        so if the source pixel is fg^bg, it produces fg when XOR'ed
  334. +        with bg, and bg when XOR'ed with bg.
  335. +        If the source pixel is zero, it produces fg when XOR'ed with
  336. +        fg, and bg when XOR'ed with bg.
  337. +        */
  338. +     XSetForeground(tool_d, gc, fg ^ bg);
  339. +     XSetBackground(tool_d, gc, 0);
  340. +     /* make pixmaps for top ruler arrow */
  341. +     toparrow_pm = XCreatePixmap(tool_d, topruler_pixwin, trm_pr.width,
  342. +                     trm_pr.height,
  343. +                     DefaultDepthOfScreen(tool_s));
  344. +     XPutImage(tool_d, toparrow_pm, gc, &trm_pr, 0, 0, 0, 0,
  345. +         trm_pr.width, trm_pr.height);
  346. +     
  347.       /* side ruler, adjustments for digits are kludges based on 6x13 char */
  348.       p = XCreatePixmap(tool_d, sideruler_pixwin,
  349.                 SIDERULER_WIDTH, SIDERULER_HEIGHT,
  350. ***************
  351. *** 317,329 ****
  352.       ruler_args[0].value = (XtArgVal)p;
  353.       XtSetValues(sideruler_sw, ruler_args, 1);
  354.   
  355. !     /* make pixmaps for ruler arrows */
  356. !     toparrow_pm = XCreatePixmap(tool_d, topruler_pixwin, trm_pr.width,
  357. !                     trm_pr.height,
  358. !                     DefaultDepthOfScreen(tool_s));
  359. !     XPutImage(tool_d, toparrow_pm, gc, &trm_pr, 0, 0, 0, 0,
  360. !         trm_pr.width, trm_pr.height);
  361. !     
  362.       if( RHS_PANEL )
  363.       {
  364.           sidearrow_pm = XCreatePixmap(tool_d, sideruler_pixwin,
  365. --- 408,418 ----
  366.       ruler_args[0].value = (XtArgVal)p;
  367.       XtSetValues(sideruler_sw, ruler_args, 1);
  368.   
  369. !     /* Colors set as above */
  370. !     XSetForeground(tool_d, gc, fg ^ bg);
  371. !     XSetBackground(tool_d, gc, 0);
  372. !     /* make pixmaps for side ruler arrow */
  373.       if( RHS_PANEL )
  374.       {
  375.           sidearrow_pm = XCreatePixmap(tool_d, sideruler_pixwin,
  376. ***************
  377. *** 434,443 ****
  378. --- 523,545 ----
  379.       ruler_args[2].value = TOPRULER_WIDTH = CANVAS_WIDTH;;
  380.       ruler_args[3].value = TOPRULER_HEIGHT = RULER_WIDTH;
  381.       ruler_args[5].value = (XtArgVal)panel_sw;
  382. +     ruler_args[7].value = (XtArgVal)NULL;
  383. +     /* fix the top & bottom to the top of the form,
  384. +        the left to the panel, and the right is rubber */
  385. +     ruler_args[10].value = (XtArgVal)XtChainTop;
  386. +     ruler_args[11].value = (XtArgVal)XtChainTop;
  387. +     ruler_args[12].value = (XtArgVal)XtRubber;
  388. +     ruler_args[13].value = (XtArgVal)XtRubber;
  389. +     
  390.       topruler_sw = XtCreateWidget("truler", labelWidgetClass, tool,
  391.           ruler_args, XtNumber(ruler_args));
  392.       return(1);
  393.   }
  394. + redisplay_topruler()
  395. + {
  396. +     XClearWindow(tool_d, topruler_pixwin);
  397. + }
  398.   #endif    X11
  399.   
  400.   #ifndef    X11
  401. ***************
  402. *** 479,485 ****
  403.   set_rulermark(x, y)
  404.   int    x, y;
  405.   {
  406. !     if( tracking )
  407.       {
  408.           set_siderulermark(y);
  409.           set_toprulermark(x);
  410. --- 581,587 ----
  411.   set_rulermark(x, y)
  412.   int    x, y;
  413.   {
  414. !     if( TRACKING )
  415.       {
  416.           set_siderulermark(y);
  417.           set_toprulermark(x);
  418. ***************
  419. *** 486,491 ****
  420. --- 588,601 ----
  421.       }
  422.   }
  423.   
  424. + #ifdef    X11
  425. + redisplay_rulers()
  426. + {
  427. +     redisplay_topruler();
  428. +     redisplay_sideruler();
  429. + }
  430. + #endif
  431.   set_siderulermark(y)
  432.   int    y;
  433.   {
  434. ***************
  435. *** 508,528 ****
  436.       lasty = sy;
  437.   #else
  438.       if( RHS_PANEL ) {
  439.           XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  440. !               gccache[INV_PAINT], 0, 0, srlm_pr.width,
  441. !               srlm_pr.height, RULER_WIDTH+srloffx, lasty + srloffy);
  442. !         XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  443. !               gccache[INV_PAINT], 0, 0, srlm_pr.width,
  444.                 srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
  445.       }
  446.       else
  447.       {
  448.           XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  449. !               gccache[INV_PAINT], 0, 0, srrm_pr.width,
  450. !               srrm_pr.height, -srroffx, lasty + srroffy);
  451. !         XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  452. !               gccache[INV_PAINT], 0, 0, srrm_pr.width,
  453. !               srrm_pr.height, -srroffx, y + srroffy);
  454.       }
  455.       lasty = y;
  456.   #endif    X11
  457. --- 618,642 ----
  458.       lasty = sy;
  459.   #else
  460.       if( RHS_PANEL ) {
  461. +         /* Because the ruler uses a background pixmap, we can win
  462. +            here by using XClearArea to erase the old thing. */
  463. +         XClearArea(tool_d, sideruler_pixwin,
  464. +                RULER_WIDTH+srloffx, lasty + srloffy,
  465. +                srlm_pr.width, srlm_pr.height, False);
  466.           XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  467. !               sidegc, 0, 0, srlm_pr.width,
  468.                 srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
  469.       }
  470.       else
  471.       {
  472. +         /* Because the ruler uses a background pixmap, we can win
  473. +            here by using XClearArea to erase the old thing. */
  474. +         XClearArea(tool_d, sideruler_pixwin,
  475. +                srroffx, lasty + srroffy,
  476. +                srlm_pr.width, srlm_pr.height, False);
  477.           XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
  478. !               sidegc, 0, 0, srrm_pr.width,
  479. !               srrm_pr.height, srroffx, y + srroffy);
  480.       }
  481.       lasty = y;
  482.   #endif    X11
  483. diff -c /tmp/main.c main.c
  484. *** /tmp/main.c    Fri Aug 26 09:38:54 1988
  485. --- main.c    Thu Aug 25 11:19:36 1988
  486. ***************
  487. *** 54,65 ****
  488.   extern int        DEBUG;
  489.   extern int        RHS_PANEL;
  490.   extern int        INVERSE;
  491.   
  492.   TOOL            tool;
  493.   int            WINDOW_WIDTH, WINDOW_HEIGHT;
  494.   char            file_header[32] = "#FIG ";
  495.   static char        *file = NULL;
  496. - int            tracking = 1;
  497.   
  498.   get_args(argc, argv)
  499.   int    argc;
  500. --- 54,65 ----
  501.   extern int        DEBUG;
  502.   extern int        RHS_PANEL;
  503.   extern int        INVERSE;
  504. + extern int        TRACKING;
  505.   
  506.   TOOL            tool;
  507.   int            WINDOW_WIDTH, WINDOW_HEIGHT;
  508.   char            file_header[32] = "#FIG ";
  509.   static char        *file = NULL;
  510.   
  511.   get_args(argc, argv)
  512.   int    argc;
  513. ***************
  514. *** 115,125 ****
  515.                    break;
  516.   
  517.                case 't':    /* turn on tracking */
  518. !                  tracking = 1;
  519.                    break;
  520.   
  521.                case 'n':    /* turn off tracking */
  522. !                  tracking = 0;
  523.                    break;
  524.                        
  525.                default:
  526. --- 115,125 ----
  527.                    break;
  528.   
  529.                case 't':    /* turn on tracking */
  530. !                  TRACKING = 1;
  531.                    break;
  532.   
  533.                case 'n':    /* turn off tracking */
  534. !                  TRACKING = 0;
  535.                    break;
  536.                        
  537.                default:
  538. ***************
  539. *** 192,198 ****
  540.       {XtNreverseVideo, XtCReverseVideo, XtRBoolean, sizeof(int),
  541.            (Cardinal)&INVERSE, XtRBoolean, (caddr_t)&false},
  542.       {"trackCursor", "Track", XtRBoolean, sizeof(int),
  543. !          (Cardinal)&tracking, XtRBoolean, (caddr_t)&true},
  544.   };
  545.   
  546.   static XrmOptionDescRec options[] =
  547. --- 192,198 ----
  548.       {XtNreverseVideo, XtCReverseVideo, XtRBoolean, sizeof(int),
  549.            (Cardinal)&INVERSE, XtRBoolean, (caddr_t)&false},
  550.       {"trackCursor", "Track", XtRBoolean, sizeof(int),
  551. !          (Cardinal)&TRACKING, XtRBoolean, (caddr_t)&true},
  552.   };
  553.   
  554.   static XrmOptionDescRec options[] =
  555. ***************
  556. *** 247,252 ****
  557. --- 247,283 ----
  558.       tool_sn = DefaultScreen(tool_d);
  559.       
  560.       gc = DefaultGC(tool_d, tool_sn);
  561. +     if( CellsOfScreen(tool_s) == 2 && INVERSE )
  562. +     {
  563. +         XrmValue    value;
  564. +         XrmDatabase newdb = (XrmDatabase) 0;
  565. +         extern XrmDatabase XtDefaultDB;
  566. +         value.size = sizeof("White");
  567. +         value.addr = "White";
  568. +         XrmPutResource(&newdb, "xfig*borderColor", "String",
  569. +                    &value);
  570. +         value.size = sizeof("White");
  571. +         value.addr = "White";
  572. +         XrmPutResource(&newdb, "xfig*foreground", "String",
  573. +                    &value);
  574. +         value.size = sizeof("Black");
  575. +         value.addr = "Black";
  576. +         XrmPutResource(&newdb, "xfig*background", "String",
  577. +                    &value);
  578. +         XrmMergeDatabases(newdb, &XtDefaultDB);
  579. +         /* now set the tool part, since its already created */
  580. +         XtSetArg(tmp_arg[0], XtNborderColor,
  581. +              WhitePixelOfScreen(tool_s));
  582. +         XtSetArg(tmp_arg[1], XtNforeground,
  583. +              WhitePixelOfScreen(tool_s));
  584. +         XtSetArg(tmp_arg[2], XtNbackground,
  585. +              BlackPixelOfScreen(tool_s));
  586. +         XtSetValues(tool, tmp_arg, 3);
  587. +     }
  588. +     
  589.       init_font();
  590.       init_cursor();
  591.       form = XtCreateManagedWidget("form", formWidgetClass, tool,
  592. ***************
  593. *** 264,270 ****
  594.           CANVAS_HEIGHT = landscape ? DEF_CANVAS_WIDTH :
  595.               DEF_CANVAS_HEIGHT;
  596.       
  597. !     if( CANVAS_HEIGHT < DEF_CANVAS_HEIGHT )
  598.           ICON_COLUMN = ICON_COLUMN_LAND;
  599.           
  600.       (void)init_panel(form);
  601. --- 295,302 ----
  602.           CANVAS_HEIGHT = landscape ? DEF_CANVAS_WIDTH :
  603.               DEF_CANVAS_HEIGHT;
  604.       
  605. !     if( (CANVAS_HEIGHT < DEF_CANVAS_HEIGHT) ||
  606. !        (HeightOfScreen(tool_s) < DEF_CANVAS_HEIGHT) )
  607.           ICON_COLUMN = ICON_COLUMN_LAND;
  608.           
  609.       (void)init_panel(form);
  610. diff -c /tmp/version.h version.h
  611. *** /tmp/version.h    Fri Aug 26 09:38:57 1988
  612. --- version.h    Wed Aug 24 08:30:22 1988
  613. ***************
  614. *** 8,11 ****
  615.   */
  616.   
  617.   #define            FIG_VERSION        "1.4"
  618. ! #define            MINOR_VERSION        ".2"
  619. --- 8,11 ----
  620.   */
  621.   
  622.   #define            FIG_VERSION        "1.4"
  623. ! #define            MINOR_VERSION        ".3"
  624. diff -c /tmp/xfig.1 xfig.1
  625. *** /tmp/xfig.1    Fri Aug 26 09:38:59 1988
  626. --- xfig.1    Thu Aug 25 15:34:19 1988
  627. ***************
  628. *** 263,269 ****
  629.   Create ellipses using the same procedure as for the drawing of circles.
  630.   .TP
  631.   .I GLUE
  632. ! Glue the primitive objects within a bounding box into a compound object
  633.   (the bounding box itself is not part of the figure; 
  634.   it is a visual aid for manipulating the compound). 
  635.   .TP
  636. --- 263,269 ----
  637.   Create ellipses using the same procedure as for the drawing of circles.
  638.   .TP
  639.   .I GLUE
  640. ! Glue the objects within a bounding box into a compound object
  641.   (the bounding box itself is not part of the figure; 
  642.   it is a visual aid for manipulating the compound). 
  643.   .TP
  644. ***************
  645. *** 302,307 ****
  646. --- 302,309 ----
  647.   Only compound objects can be scaled.  Click the left button
  648.   on a corner of the bounding box, stretch the
  649.   bounding box to the desired size, and click the middle button.
  650. + Or click the left button on a side of the bounding box, stretch that
  651. + side to the desired size, and click the middle button.
  652.   .TP
  653.   .I SPLINE
  654.   Create (quadratic spline) spline objects.
  655. ***************
  656. *** 313,319 ****
  657.   .I TEXT
  658.   Create text strings. Click the left button at the desired position on
  659.   the canvas window, then enter text from the keyboard.
  660. ! Terminate by clicking the middle button or typing the return key.
  661.   .TP
  662.   .I TURN
  663.   Turn \fIPOLYGON\fP into a \fICLOSED INTERPOLATED SPLINE\fP object, or
  664. --- 315,325 ----
  665.   .I TEXT
  666.   Create text strings. Click the left button at the desired position on
  667.   the canvas window, then enter text from the keyboard.
  668. ! A DEL or ^H (backspace) will delete a character, while a ^U will kill
  669. ! the entire line.
  670. ! Terminate by clicking the middle button or typing the return key.  To
  671. ! edit text, click on an existing text string with the left button.
  672. ! Insertion of characters will take place at that point.  
  673.   .TP
  674.   .I TURN
  675.   Turn \fIPOLYGON\fP into a \fICLOSED INTERPOLATED SPLINE\fP object, or
  676. ***************
  677. *** 466,484 ****
  678.   .SH ACKNOWLEDGEMENT
  679.   Many thanks goes to Professor Donald E. Fussell who inspired the
  680.   creation of this tool.
  681. ! .SH AUTHOR
  682.   Supoj Sutanthavibul
  683.   .br
  684.   University of Texas at Austin 
  685.   .br
  686. ! (supoj@sally.UTEXAS.EDU) 
  687.   .sp
  688. ! Manual page modified by R. P. C. Rodgers, UCSF School of Pharmacy,
  689.   San Francisco, CA 94118 
  690.   .sp
  691. ! Frank Schmuck of Cornell contributed the LaTeX line drawing modes.
  692.   .sp
  693. ! X11 port by Ken Yap (ken@cs.rochester.edu).
  694.   .sp
  695.   Variable window sizes, cleanup of X11 port, right hand side panel
  696. ! under X11, X11 manual page provided by Dana Chee (dana@bellcore.com).
  697. --- 472,522 ----
  698.   .SH ACKNOWLEDGEMENT
  699.   Many thanks goes to Professor Donald E. Fussell who inspired the
  700.   creation of this tool.
  701. ! .SH AUTHORS
  702. ! Original author:
  703. ! .br
  704.   Supoj Sutanthavibul
  705.   .br
  706.   University of Texas at Austin 
  707.   .br
  708. ! (supoj@sally.utexas.edu) 
  709.   .sp
  710. ! Manual page modified by:
  711. ! .br
  712. ! R. P. C. Rodgers
  713. ! .br
  714. ! UCSF School of Pharmacy
  715. ! .br
  716.   San Francisco, CA 94118 
  717.   .sp
  718. ! The LaTeX line drawing modes were contributed by:
  719. ! .br
  720. ! Frank Schmuck
  721. ! .br
  722. ! Cornell University
  723.   .sp
  724. ! X11 port by:
  725. ! .br
  726. ! Ken Yap
  727. ! .br
  728. ! Rochester
  729. ! .br
  730. ! (ken@cs.rochester.edu)
  731.   .sp
  732.   Variable window sizes, cleanup of X11 port, right hand side panel
  733. ! under X11, X11 manual page provided by:
  734. ! .br
  735. ! Dana Chee
  736. ! .br
  737. ! Bellcore
  738. ! .br
  739. ! (dana@bellcore.com)
  740. ! .sp
  741. ! Cleanup of color port to X11 by:
  742. ! .br
  743. ! John T. Kohl
  744. ! .br
  745. ! MIT
  746. ! .br
  747. ! (jtkohl@athena.mit.edu)
  748. diff -c /tmp/scale.c scale.c
  749. *** /tmp/scale.c    Fri Aug 26 09:39:02 1988
  750. --- scale.c    Thu Aug 25 15:51:04 1988
  751. ***************
  752. *** 21,27 ****
  753.   extern int        fix_x, fix_y, cur_x, cur_y;
  754.   extern F_pos        last_position, new_position;  /* used in undo */
  755.   
  756. ! extern F_compound    *compound_point_search();
  757.   extern            (*canvas_kbd_proc)();
  758.   extern            (*canvas_locmove_proc)();
  759.   extern            (*canvas_leftbut_proc)();
  760. --- 21,27 ----
  761.   extern int        fix_x, fix_y, cur_x, cur_y;
  762.   extern F_pos        last_position, new_position;  /* used in undo */
  763.   
  764. ! extern F_compound    *compound_point_search(), *compound_search();
  765.   extern            (*canvas_kbd_proc)();
  766.   extern            (*canvas_locmove_proc)();
  767.   extern            (*canvas_leftbut_proc)();
  768. ***************
  769. *** 32,41 ****
  770.   
  771.               prescale_compound(), elastic_compoundbox();
  772.   
  773.   static F_compound    *compound;
  774.   static double        cosa, sina;
  775.   static int        fromx, fromy;
  776.               init_scale_compound();
  777.   
  778.   scale_compound_selected()
  779. --- 32,42 ----
  780.   
  781.               prescale_compound(), elastic_compoundbox();
  782.   
  783. + static enum        {WEST, NORTH, EAST, SOUTH, CORNER} side;
  784. + static int        save_coord;
  785.   static F_compound    *compound;
  786.   static double        cosa, sina;
  787.   static int        fromx, fromy;
  788.               init_scale_compound();
  789.   
  790.   scale_compound_selected()
  791. ***************
  792. *** 53,89 ****
  793.   int    x, y;
  794.   {
  795.       double    dx, dy, l;
  796. !     if ((compound = compound_point_search(x, y, TOLERANCE, &cur_x, &cur_y)) 
  797. !         == NULL) {
  798. !         return;
  799. !         }
  800. !     if (compound->nwcorner.x == cur_x) 
  801. !         fix_x = compound->secorner.x;
  802. !     else
  803. !         fix_x = compound->nwcorner.x;
  804. !     if (compound->nwcorner.y == cur_y) 
  805. !         fix_y = compound->secorner.y;
  806. !     else
  807. !         fix_y = compound->nwcorner.y;
  808. !     dx = cur_x - fix_x;  dy = cur_y - fix_y;
  809. !     l = sqrt(dx*dx + dy*dy);
  810. !     cosa = fabs(dx / l);  sina = fabs(dy / l);
  811. !     fromx = cur_x;  fromy = cur_y;
  812. !     win_setmouseposition(canvas_swfd, cur_x, cur_y);
  813. !     draw_compoundbox(compound, INV_PAINT);
  814. !     draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  815. !     set_latestcompound(compound);
  816. !     canvas_locmove_proc = elastic_compoundbox;
  817. !     canvas_middlebut_proc = prescale_compound;
  818. !     canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  819. !     set_action_on();
  820. !     set_temp_cursor(&null_cursor);
  821. !     win_setmouseposition(canvas_swfd, x, y);
  822.       }
  823.   
  824.   elastic_compoundbox(x, y)
  825.   int    x, y;
  826.   {
  827. --- 54,149 ----
  828.   int    x, y;
  829.   {
  830.       double    dx, dy, l;
  831. !     
  832. !     if ((compound = compound_point_search(x, y, TOLERANCE, &cur_x,
  833. !                           &cur_y)) != NULL)
  834. !     {
  835. !         if (compound->nwcorner.x == cur_x) 
  836. !             fix_x = compound->secorner.x;
  837. !         else
  838. !             fix_x = compound->nwcorner.x;
  839. !         if (compound->nwcorner.y == cur_y) 
  840. !             fix_y = compound->secorner.y;
  841. !         else
  842. !             fix_y = compound->nwcorner.y;
  843. !         
  844. !         side = CORNER;
  845. !         dx = cur_x - fix_x;  dy = cur_y - fix_y;
  846. !         l = sqrt(dx*dx + dy*dy);
  847. !         cosa = fabs(dx / l);  sina = fabs(dy / l);
  848. !         
  849. !         fromx = cur_x;  fromy = cur_y;
  850. !         win_setmouseposition(canvas_swfd, cur_x, cur_y);
  851. !         draw_compoundbox(compound, INV_PAINT);
  852. !         draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  853. !         set_latestcompound(compound);
  854. !         canvas_locmove_proc = elastic_compoundbox;
  855. !         canvas_middlebut_proc = prescale_compound;
  856. !         canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  857. !         set_action_on();
  858. !         set_temp_cursor(&null_cursor);
  859. !         win_setmouseposition(canvas_swfd, x, y);
  860.       }
  861. +     else if ((compound = compound_search(x, y, TOLERANCE, &cur_x, &cur_y))
  862. +          != NULL )
  863. +     {
  864. +         /* figure out which side the cursor is close to. */
  865. +         if (compound->nwcorner.x == cur_x)
  866. +             side = WEST;
  867. +         else if (compound->nwcorner.y == cur_y)
  868. +             side = NORTH;
  869. +         else if (compound->secorner.x == cur_x)
  870. +             side = EAST;
  871. +         else if (compound->secorner.y == cur_y)
  872. +             side = SOUTH;
  873. +         else
  874. +             return;
  875. +         
  876. +         /* figure out a fixed point of the compound for scaling */
  877. +         switch (side) {
  878. +         case WEST:
  879. +         case NORTH:
  880. +             fix_x = compound->secorner.x;
  881. +             fix_y = compound->secorner.y;
  882. +             cur_x = compound->nwcorner.x;
  883. +             cur_y = compound->nwcorner.y;
  884. +             break;
  885. +         case EAST:
  886. +         case SOUTH:
  887. +             fix_x = compound->nwcorner.x;
  888. +             fix_y = compound->nwcorner.y;
  889. +             cur_x = compound->secorner.x;
  890. +             cur_y = compound->secorner.y;
  891. +             break;
  892. +         }
  893. +         
  894. +         /* save initial corner position */
  895. +         fromx = cur_x;  fromy = cur_y;
  896. +         /* save x or y coordinate for restoring the cursor */
  897. +         /* at the end of the scaling */
  898. +         switch (side) {
  899. +         case NORTH: case SOUTH:
  900. +             save_coord = x;
  901. +             break;
  902. +         case EAST: case WEST:
  903. +             save_coord = y;
  904. +             break;
  905. +         }
  906. +         /*  erase the compound box. */
  907. +         win_setmouseposition(canvas_swfd, cur_x, cur_y);
  908. +         draw_compoundbox(compound, INV_PAINT);
  909. +         draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  910. +         set_latestcompound(compound);
  911. +         canvas_locmove_proc = elastic_compoundbox;
  912. +         canvas_middlebut_proc = prescale_compound;
  913. +         canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  914. +         set_action_on();
  915. +         set_temp_cursor(&null_cursor);
  916. +         win_setmouseposition(canvas_swfd, x, y);
  917. +     }
  918. + }
  919.   
  920.   elastic_compoundbox(x, y)
  921.   int    x, y;
  922.   {
  923. ***************
  924. *** 98,115 ****
  925.   {
  926.       double    xx, yy, d;
  927.   
  928. !     xx = x - fix_x;
  929. !     yy = y - fix_y;
  930. !     d = sqrt(xx*xx + yy*yy);
  931. !     if (xx < 0)
  932. !         cur_x = fix_x - round(d * cosa);
  933. !     else
  934. !         cur_x = fix_x + round(d * cosa);
  935. !     if (yy < 0)
  936. !         cur_y = fix_y - round(d * sina);
  937. !     else
  938. !         cur_y = fix_y + round(d * sina);
  939.       }
  940.   
  941.   prescale_compound(x, y)
  942.   int    x, y;
  943. --- 158,187 ----
  944.   {
  945.       double    xx, yy, d;
  946.   
  947. !     switch(side) {
  948. !     case CORNER:
  949. !         xx = x - fix_x;
  950. !         yy = y - fix_y;
  951. !         d = sqrt(xx*xx + yy*yy);
  952. !         if (xx < 0)
  953. !             cur_x = fix_x - round(d * cosa);
  954. !         else
  955. !             cur_x = fix_x + round(d * cosa);
  956. !         if (yy < 0)
  957. !             cur_y = fix_y - round(d * sina);
  958. !         else
  959. !             cur_y = fix_y + round(d * sina);
  960. !         break;
  961. !     case NORTH:
  962. !     case SOUTH:
  963. !         cur_y = y;
  964. !         break;
  965. !     case EAST:
  966. !     case WEST:
  967. !         cur_x = x;
  968. !         break;
  969.       }
  970. + }
  971.   
  972.   prescale_compound(x, y)
  973.   int    x, y;
  974. ***************
  975. *** 130,135 ****
  976. --- 202,218 ----
  977.       last_position.y = fromy;
  978.       new_position.x = cur_x;
  979.       new_position.y = cur_y;
  980. +     /* update cursor position for single axis scaling. */
  981. +     switch (side) {
  982. +     case NORTH: case SOUTH:
  983. +         /* maintain old horiz. pos. */
  984. +         cur_x = save_coord;
  985. +         break;
  986. +     case EAST: case WEST:
  987. +         /* maintain old vert. pos. */
  988. +         cur_y = save_coord;
  989. +         break;
  990. +     }
  991.       clean_up();
  992.       set_action_object(F_SCALE, O_COMPOUND);
  993.       set_latestcompound(compound);
  994. ***************
  995. *** 147,152 ****
  996. --- 230,236 ----
  997.       F_ellipse    *e;
  998.       F_text        *t;
  999.       F_arc        *a;
  1000. +     F_compound    *c1;
  1001.       int        x1, y1, x2, y2;
  1002.   
  1003.       x1 = round(refx + (c->nwcorner.x - refx) * sx);
  1004. ***************
  1005. *** 172,177 ****
  1006. --- 256,264 ----
  1007.           }
  1008.       for (t = c->texts; t != NULL; t = t->next) {
  1009.           scale_text(t, sx, sy, refx, refy);
  1010. +         }
  1011. +     for (c1 = c->compounds; c1 != NULL; c1 = c1->next) {
  1012. +         scale_compound(c1, sx, sy, refx, refy);
  1013.           }
  1014.       }
  1015.   
  1016. diff -c /tmp/canvas.c canvas.c
  1017. *** /tmp/canvas.c    Fri Aug 26 09:39:05 1988
  1018. --- canvas.c    Fri Aug 26 08:51:04 1988
  1019. ***************
  1020. *** 150,155 ****
  1021. --- 150,156 ----
  1022.       { XtNhorizDistance, (XtArgVal)0 },
  1023.       { XtNfromVert, (XtArgVal)NULL },
  1024.       { XtNvertDistance, (XtArgVal)0 },
  1025. +     { XtNtop, (XtArgVal)XtChainTop },
  1026.   };
  1027.   
  1028.   static void canvas_exposed(tool, event, params, nparams)
  1029. ***************
  1030. *** 161,166 ****
  1031. --- 162,168 ----
  1032.       if (((XExposeEvent *)event)->count > 0)
  1033.           return;
  1034.       redisplay_canvas();
  1035. +     redisplay_rulers();
  1036.   }
  1037.   
  1038.   static void set_pos(tool, event, params, nparams)
  1039. ***************
  1040. *** 193,201 ****
  1041. --- 195,210 ----
  1042.       <Key>:Event()\n\
  1043.       <Expose>:Expose()\n";
  1044.   
  1045. + static    Arg    canvas_color_args[] = {
  1046. +     { XtNforeground, (XtArgVal) &x_fg_color.pixel },
  1047. +     { XtNbackground, (XtArgVal) &x_bg_color.pixel },
  1048. + };
  1049.   int init_canvas(tool)
  1050.       TOOL        tool;
  1051.   {
  1052. +     XColor    fixcolors[2];
  1053. +     
  1054.       canvas_args[3].value = CANVAS_WIDTH;
  1055.       canvas_args[4].value = CANVAS_HEIGHT;
  1056.       canvas_args[5].value = (XtArgVal)panel_sw;
  1057. ***************
  1058. *** 202,207 ****
  1059. --- 211,233 ----
  1060.       canvas_args[7].value = (XtArgVal)topruler_sw;
  1061.       canvas_sw = XtCreateWidget("canvas", labelWidgetClass, tool,
  1062.           canvas_args, XtNumber(canvas_args));
  1063. +     XtGetValues(canvas_sw, canvas_color_args, XtNumber(canvas_color_args));
  1064. +     /* get the RGB values for recolor cursor use -- may want to have
  1065. +        cursor color resource */
  1066. +     fixcolors[0] = x_fg_color;
  1067. +     fixcolors[1] = x_bg_color;
  1068. +     XQueryColors(tool_d, DefaultColormapOfScreen(tool_s), fixcolors, 2);
  1069. +     x_fg_color = fixcolors[0];
  1070. +     x_bg_color = fixcolors[1];
  1071. +     
  1072. +     /* now fix the global GC */
  1073. +     XSetState(tool_d, gc, x_fg_color.pixel, x_bg_color.pixel, GXcopy,
  1074. +           AllPlanes);
  1075. +     
  1076. +     /* and recolor the cursors */
  1077. +     recolor_cursors();
  1078. +     
  1079.       canvas_leftbut_proc = null_proc;
  1080.       canvas_middlebut_proc = null_proc;
  1081.       canvas_rightbut_proc = null_proc;
  1082. ***************
  1083. *** 240,245 ****
  1084. --- 266,286 ----
  1085.       switch (event->type)
  1086.       {
  1087.       case MotionNotify:
  1088. +         {
  1089. +             Window rw, cw;
  1090. +             static int sx = -10000, sy = -10000;
  1091. +             int rx, ry, cx, cy;
  1092. +             unsigned int mask;
  1093. +             XQueryPointer(event->display, event->window,
  1094. +                       &rw, &cw,
  1095. +                       &rx, &ry,
  1096. +                       &cx, &cy,
  1097. +                       &mask);
  1098. +             if(cx == sx && cy == sy) break;
  1099. +             x = sx = cx;
  1100. +             y = sy = cy;
  1101. +         }
  1102.           set_rulermark(x, y);
  1103.           (*canvas_locmove_proc)(x, y);
  1104.           break;
  1105. diff -c /tmp/cursor.c cursor.c
  1106. *** /tmp/cursor.c    Fri Aug 26 09:39:07 1988
  1107. --- cursor.c    Wed Aug 24 15:37:56 1988
  1108. ***************
  1109. *** 106,109 ****
  1110. --- 106,128 ----
  1111.       vbar_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_xterm);
  1112.       wait_cursor.bitmap = (XImage *)XCreateFontCursor(d, XC_watch);
  1113.   }
  1114. + recolor_cursors()
  1115. + {
  1116. +     register Display  *d = tool_d;
  1117. +     
  1118. +     XRecolorCursor(d, (Cursor)arrow_cursor.bitmap, &x_fg_color, &x_bg_color);
  1119. +     XRecolorCursor(d, (Cursor)bull_cursor.bitmap, &x_fg_color, &x_bg_color);
  1120. +     XRecolorCursor(d, (Cursor)buster_cursor.bitmap, &x_fg_color, &x_bg_color);
  1121. +     XRecolorCursor(d, (Cursor)char_cursor.bitmap, &x_fg_color, &x_bg_color);
  1122. +     XRecolorCursor(d, (Cursor)crosshair_cursor.bitmap, &x_fg_color,
  1123. +                &x_bg_color);
  1124. +     XRecolorCursor(d, (Cursor)null_cursor.bitmap, &x_fg_color, &x_bg_color);
  1125. +     XRecolorCursor(d, (Cursor)magnifier_cursor.bitmap, &x_fg_color,
  1126. +                &x_bg_color);
  1127. +     XRecolorCursor(d, (Cursor)pencil_cursor.bitmap, &x_fg_color, &x_bg_color);
  1128. +     XRecolorCursor(d, (Cursor)pick15_cursor.bitmap, &x_fg_color, &x_bg_color);
  1129. +     XRecolorCursor(d, (Cursor)pick9_cursor.bitmap, &x_fg_color, &x_bg_color);
  1130. +     XRecolorCursor(d, (Cursor)vbar_cursor.bitmap, &x_fg_color, &x_bg_color);
  1131. +     XRecolorCursor(d, (Cursor)wait_cursor.bitmap, &x_fg_color, &x_bg_color);
  1132. + }
  1133.   #endif    X11
  1134. diff -c /tmp/xtra.c xtra.c
  1135. *** /tmp/xtra.c    Fri Aug 26 09:39:09 1988
  1136. --- xtra.c    Fri Aug 26 08:51:07 1988
  1137. ***************
  1138. *** 12,17 ****
  1139. --- 12,24 ----
  1140.   #include "paintop.h"
  1141.   #include "font.h"
  1142.   
  1143. + #define    CTRL_H    8
  1144. + #define    NL    10
  1145. + #define    CR    13
  1146. + #define    CTRL_U    21
  1147. + #define    CTRL_X    24
  1148. + #define    DEL    127
  1149.   pr_size pf_textwidth(n, f, s)
  1150.       int        n;
  1151.       XFontStruct    *f;
  1152. ***************
  1153. *** 27,50 ****
  1154.       return (ret);
  1155.   }
  1156.   
  1157. ! static GC makegc(op)
  1158.   {
  1159.       register GC    ngc;
  1160.       XGCValues    gcv;
  1161.   
  1162. !     ngc = XCreateGC(tool_d, XtWindow(canvas_sw), 0, &gcv);
  1163. !     XCopyGC(tool_d, gc, ~0, ngc);
  1164. !     XSetFunction(tool_d, ngc, op);
  1165. !     XSetFont(tool_d, ngc, roman_font->fid);
  1166.       return (ngc);
  1167.   }
  1168.   
  1169.   init_gc()
  1170.   {
  1171. !     gccache[PAINT] = makegc(PAINT);
  1172. !     gccache[ERASE] = makegc(ERASE);
  1173. !     gccache[INV_PAINT] = makegc(INV_PAINT);
  1174. !     gccache[MERGE] = makegc(MERGE);
  1175.   }
  1176.   
  1177.   /*
  1178. --- 34,110 ----
  1179.       return (ret);
  1180.   }
  1181.   
  1182. ! static GC makegc(op, fg, bg)
  1183. ! int    op;
  1184. ! Pixel    fg;
  1185. ! Pixel    bg;
  1186.   {
  1187.       register GC    ngc;
  1188.       XGCValues    gcv;
  1189. +     int        gcmask;
  1190.   
  1191. !     gcv.font = roman_font->fid;
  1192. !     gcmask = GCFunction|GCForeground|GCBackground|GCFont;
  1193. !     switch (op) {
  1194. !     case PAINT:
  1195. !         gcv.foreground = fg;
  1196. !         gcv.background = bg;
  1197. !         gcv.function = GXcopy;
  1198. !         break;
  1199. !     case ERASE:
  1200. !         gcv.foreground = bg;
  1201. !         gcv.background = bg;
  1202. !         gcv.function = GXcopy;
  1203. !         break;
  1204. !     case INV_PAINT:
  1205. !         gcv.foreground = fg ^ bg;
  1206. !         gcv.background = bg;
  1207. !         gcv.function = GXxor;
  1208. !         break;
  1209. !     case MERGE:
  1210. !         gcv.foreground = fg;
  1211. !         gcv.background = bg;
  1212. !         gcv.function = GXor;
  1213. !         break;
  1214. !     }
  1215. !     
  1216. !     ngc = XCreateGC(tool_d, XtWindow(canvas_sw), gcmask, &gcv);
  1217. !     XCopyGC(tool_d, gc, ~(gcmask), ngc);
  1218.       return (ngc);
  1219.   }
  1220.   
  1221. + static GC    msg_gccache[0x10];
  1222.   init_gc()
  1223.   {
  1224. !     Pixel    bg, fg;
  1225. !     Arg    tmp_arg[2];
  1226. !     
  1227. !     gccache[PAINT] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
  1228. !     gccache[ERASE] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
  1229. !     gccache[INV_PAINT] = makegc(INV_PAINT, x_fg_color.pixel,
  1230. !                     x_bg_color.pixel);
  1231. !     gccache[MERGE] = makegc(MERGE, x_fg_color.pixel, x_bg_color.pixel);
  1232. !     /* Need to get the values so we can make GC's which XOR correctly */
  1233. !     XtSetArg(tmp_arg[0], XtNforeground, &fg);
  1234. !     XtSetArg(tmp_arg[1], XtNbackground, &bg);
  1235. !     XtGetValues(msg_sw, tmp_arg, 2);
  1236. !     msg_gccache[PAINT] = makegc(PAINT, fg, bg);
  1237. !     msg_gccache[ERASE] = makegc(ERASE, fg, bg);
  1238. !     
  1239. !     XtSetArg(tmp_arg[0], XtNforeground, &fg);
  1240. !     XtSetArg(tmp_arg[1], XtNbackground, &bg);
  1241. !     XtGetValues(topruler_sw, tmp_arg, 2);
  1242. !     topgc = makegc(INV_PAINT, fg, bg);
  1243. !     
  1244. !     XtSetArg(tmp_arg[0], XtNforeground, &fg);
  1245. !     XtSetArg(tmp_arg[1], XtNbackground, &bg);
  1246. !     XtGetValues(sideruler_sw, tmp_arg, 2);
  1247. !     
  1248. !     sidegc = makegc(INV_PAINT, fg, bg);
  1249.   }
  1250.   
  1251.   /*
  1252. ***************
  1253. *** 117,127 ****
  1254.       XWindowAttributes    attr;
  1255.   
  1256.       XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
  1257. !     /* uses knowledge that gccache[PAINT] uses roman_font - tsk */
  1258.       len = strlen(prompt);
  1259.       width = char_width(roman_font);
  1260.       y = char_height(roman_font) + 2;
  1261. !     XDrawString(tool_d, msgswfd, gccache[PAINT], 2, y, prompt, len);
  1262.       x = width * len + 4;
  1263.       XGetWindowAttributes(tool_d, msgswfd, &attr);
  1264.       XSelectInput(tool_d, msgswfd, attr.your_event_mask | KeyPressMask);
  1265. --- 177,187 ----
  1266.       XWindowAttributes    attr;
  1267.   
  1268.       XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
  1269. !     /* uses knowledge that msg_gccache[PAINT] uses roman_font - tsk */
  1270.       len = strlen(prompt);
  1271.       width = char_width(roman_font);
  1272.       y = char_height(roman_font) + 2;
  1273. !     XDrawString(tool_d, msgswfd, msg_gccache[PAINT], 2, y, prompt, len);
  1274.       x = width * len + 4;
  1275.       XGetWindowAttributes(tool_d, msgswfd, &attr);
  1276.       XSelectInput(tool_d, msgswfd, attr.your_event_mask | KeyPressMask);
  1277. ***************
  1278. *** 134,161 ****
  1279.               continue;
  1280.           switch (buf[0])
  1281.           {
  1282. !         case '\b':
  1283. !         case '\0177':
  1284.               if (r != reply)
  1285.               {
  1286.                   x -= width;
  1287.                   --r;
  1288. !                 XDrawString(tool_d, msgswfd, gccache[ERASE],
  1289.                       x, y, r, 1);
  1290.               }
  1291.               break;
  1292. !         case 'U' & 0x1f:
  1293. !         case 'X' & 0x1f:
  1294.               while (r != reply)
  1295.               {
  1296.                   x -= width;
  1297.                   --r;
  1298. !                 XDrawString(tool_d, msgswfd, gccache[ERASE],
  1299.                       x, y, r, 1);
  1300.               }
  1301.               break;
  1302. !         case '\n':
  1303. !         case '\r':
  1304.               *r = '\0';
  1305.               XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
  1306.               return;
  1307. --- 194,221 ----
  1308.               continue;
  1309.           switch (buf[0])
  1310.           {
  1311. !         case CTRL_H:
  1312. !         case DEL:
  1313.               if (r != reply)
  1314.               {
  1315.                   x -= width;
  1316.                   --r;
  1317. !                 XDrawString(tool_d, msgswfd, msg_gccache[ERASE],
  1318.                       x, y, r, 1);
  1319.               }
  1320.               break;
  1321. !         case CTRL_U:
  1322. !         case CTRL_X:
  1323.               while (r != reply)
  1324.               {
  1325.                   x -= width;
  1326.                   --r;
  1327. !                 XDrawString(tool_d, msgswfd, msg_gccache[ERASE],
  1328.                       x, y, r, 1);
  1329.               }
  1330.               break;
  1331. !         case CR:
  1332. !         case NL:
  1333.               *r = '\0';
  1334.               XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
  1335.               return;
  1336. ***************
  1337. *** 162,168 ****
  1338.           default:
  1339.               if (buf[0] < ' ' || buf[0] > '~')
  1340.                   continue;
  1341. !             XDrawString(tool_d, msgswfd, gccache[PAINT],
  1342.                   x, y, buf, 1);
  1343.               x += width;
  1344.               *r++ = buf[0];
  1345. --- 222,228 ----
  1346.           default:
  1347.               if (buf[0] < ' ' || buf[0] > '~')
  1348.                   continue;
  1349. !             XDrawString(tool_d, msgswfd, msg_gccache[PAINT],
  1350.                   x, y, buf, 1);
  1351.               x += width;
  1352.               *r++ = buf[0];
  1353. diff -c /tmp/glue.c glue.c
  1354. *** /tmp/glue.c    Fri Aug 26 09:39:11 1988
  1355. --- glue.c    Thu Aug 25 12:08:44 1988
  1356. ***************
  1357. *** 106,111 ****
  1358. --- 106,113 ----
  1359.           c->secorner.x, c->secorner.y);
  1360.       get_arc(&c->arcs, c->nwcorner.x, c->nwcorner.y,
  1361.           c->secorner.x, c->secorner.y);
  1362. +     get_compound(&c->compounds, c->nwcorner.x, c->nwcorner.y,
  1363. +              c->secorner.x, c->secorner.y);
  1364.       /*  get rid of point-marker  */
  1365.       if (pointmarker_shown) toggle_compoundpointmarker(c);
  1366.       if (c->ellipses != NULL) return(1);
  1367. ***************
  1368. *** 113,118 ****
  1369. --- 115,121 ----
  1370.       if (c->lines != NULL) return(1);
  1371.       if (c->texts != NULL) return(1);
  1372.       if (c->arcs != NULL) return(1);
  1373. +     if (c->compounds != NULL) return(1);
  1374.       return(0);
  1375.       }
  1376.   
  1377. ***************
  1378. *** 269,274 ****
  1379. --- 272,318 ----
  1380.           }
  1381.       }
  1382.   
  1383. + get_compound(list, xmin, ymin, xmax, ymax)
  1384. + F_compound    **list;
  1385. + int    xmin, ymin, xmax, ymax;
  1386. + {
  1387. +     F_compound    *compd, *c, *cc;
  1388. +     for (c = objects.compounds; c != NULL;)
  1389. +     {
  1390. +         if (xmin > c->nwcorner.x)
  1391. +         {
  1392. +             cc = c;
  1393. +             c = c->next;
  1394. +             continue;
  1395. +         }
  1396. +         if (xmax < c->secorner.x)
  1397. +         {
  1398. +             cc = c;
  1399. +             c = c->next;
  1400. +             continue;
  1401. +         }
  1402. +         if (ymin > c->nwcorner.y)
  1403. +         {
  1404. +             cc = c;
  1405. +             c = c->next;
  1406. +             continue;
  1407. +         }
  1408. +         if (ymax < c->secorner.y)
  1409. +         {
  1410. +             cc = c;
  1411. +             c = c->next;
  1412. +             continue;
  1413. +         }
  1414. +         compd = c;
  1415. +         if (c == objects.compounds) 
  1416. +             c = objects.compounds = objects.compounds->next;
  1417. +         else
  1418. +             c = cc->next = c->next;
  1419. +         compd->next = *list;
  1420. +         *list = compd;
  1421. +     }
  1422. + }
  1423.   F_compound *
  1424.   compound_point_search(x, y, tol, px, py)
  1425.   int    x, y, tol, *px, *py;
  1426. ***************
  1427. *** 308,314 ****
  1428.   F_compound    *c;
  1429.   {
  1430.       draw_compoundelements(c, foreground_color, foreground_color,
  1431. !                 PAINT, PAINT, PAINT);
  1432.       }
  1433.   
  1434.   erase_compound(c)
  1435. --- 352,358 ----
  1436.   F_compound    *c;
  1437.   {
  1438.       draw_compoundelements(c, foreground_color, foreground_color,
  1439. !                 PAINT, PAINT, PAINT, PAINT);
  1440.       }
  1441.   
  1442.   erase_compound(c)
  1443. ***************
  1444. *** 315,326 ****
  1445.   F_compound    *c;
  1446.   {
  1447.       draw_compoundelements(c, background_color, background_color,
  1448. !                 ERASE, ERASE, INV_PAINT);
  1449.       }
  1450.   
  1451. ! draw_compoundelements(c, arcop, ellipseop, lineop, splineop, textop)
  1452.   F_compound    *c;
  1453. ! int        arcop, ellipseop, lineop, splineop, textop;
  1454.   {
  1455.       F_line        *l;
  1456.       F_spline    *s;
  1457. --- 359,370 ----
  1458.   F_compound    *c;
  1459.   {
  1460.       draw_compoundelements(c, background_color, background_color,
  1461. !                 ERASE, ERASE, INV_PAINT, ERASE);
  1462.       }
  1463.   
  1464. ! draw_compoundelements(c, arcop, ellipseop, lineop, splineop, textop, compop)
  1465.   F_compound    *c;
  1466. ! int        arcop, ellipseop, lineop, splineop, textop, compop;
  1467.   {
  1468.       F_line        *l;
  1469.       F_spline    *s;
  1470. ***************
  1471. *** 327,333 ****
  1472.       F_ellipse    *e;
  1473.       F_text        *t;
  1474.       F_arc        *a;
  1475.       pw_batch_on(canvas_pixwin);
  1476.       for (l = c->lines; l != NULL; l = l->next) {
  1477.           draw_line(l, lineop);
  1478. --- 371,378 ----
  1479.       F_ellipse    *e;
  1480.       F_text        *t;
  1481.       F_arc        *a;
  1482. !     F_compound    *c1;
  1483. !     
  1484.       pw_batch_on(canvas_pixwin);
  1485.       for (l = c->lines; l != NULL; l = l->next) {
  1486.           draw_line(l, lineop);
  1487. ***************
  1488. *** 344,349 ****
  1489. --- 389,398 ----
  1490.       for (t = c->texts; t != NULL; t = t->next) {
  1491.           draw_text(t, textop);
  1492.           }
  1493. +     for (c1 = c->compounds; c1 != NULL; c1 = c1->next) {
  1494. +         draw_compoundbox(c1, INV_PAINT);
  1495. +         compop == ERASE ? erase_compound(c1) : draw_compound(c1);
  1496. +         }
  1497.       pw_batch_off(canvas_pixwin);
  1498.       }
  1499.   
  1500. ***************
  1501. *** 414,416 ****
  1502. --- 463,468 ----
  1503.       for (c = objects.compounds; c != NULL; c = c->next) 
  1504.           draw_compoundbox(c, INV_PAINT);
  1505.       }
  1506. diff -c /tmp/resources.h resources.h
  1507. *** /tmp/resources.h    Fri Aug 26 09:39:14 1988
  1508. --- resources.h    Thu Aug 25 13:27:17 1988
  1509. ***************
  1510. *** 146,152 ****
  1511.   EXTERN Display        *tool_d;
  1512.   EXTERN Screen        *tool_s;
  1513.   EXTERN int        tool_sn;
  1514. ! EXTERN GC        gc, gccache[0x10];
  1515.   
  1516.   struct icon {
  1517.       short         ic_width, ic_height;    /* overall icon dimensions */
  1518. --- 146,153 ----
  1519.   EXTERN Display        *tool_d;
  1520.   EXTERN Screen        *tool_s;
  1521.   EXTERN int        tool_sn;
  1522. ! EXTERN GC        gc, gccache[0x10], topgc, sidegc;
  1523. ! EXTERN XColor        x_fg_color, x_bg_color;
  1524.   
  1525.   struct icon {
  1526.       short         ic_width, ic_height;    /* overall icon dimensions */
  1527. diff -c /tmp/global.c global.c
  1528. *** /tmp/global.c    Fri Aug 26 09:39:16 1988
  1529. --- global.c    Thu Aug 25 11:21:04 1988
  1530. ***************
  1531. *** 115,120 ****
  1532. --- 115,121 ----
  1533.   int            DEBUG = 0;
  1534.   int            RHS_PANEL = 0;
  1535.   int            INVERSE = 0;
  1536. + int            TRACKING = 1;
  1537.   
  1538.   /************************  Status  ****************************/
  1539.   
  1540. diff -c /tmp/popup.c popup.c
  1541. *** /tmp/popup.c    Fri Aug 26 09:39:18 1988
  1542. --- popup.c    Thu Aug 25 14:17:11 1988
  1543. ***************
  1544. *** 96,102 ****
  1545.       XtTranslations        popdown_actions, pane_actions;
  1546.   
  1547.       menu = XtCreatePopupShell("popup_menu", overrideShellWidgetClass, tool,
  1548. !         menu_args, 0);
  1549.       popdown_actions = XtParseTranslationTable(
  1550.           "<Btn3Up>:MenuPopdown()\n\
  1551.           <LeaveWindow>:MenuPopdown()\n");
  1552. --- 96,102 ----
  1553.       XtTranslations        popdown_actions, pane_actions;
  1554.   
  1555.       menu = XtCreatePopupShell("popup_menu", overrideShellWidgetClass, tool,
  1556. !         menu_args, XtNumber(menu_args));
  1557.       popdown_actions = XtParseTranslationTable(
  1558.           "<Btn3Up>:MenuPopdown()\n\
  1559.           <LeaveWindow>:MenuPopdown()\n");
  1560. diff -c /tmp/flip.c flip.c
  1561. *** /tmp/flip.c    Fri Aug 26 09:39:21 1988
  1562. --- flip.c    Thu Aug 25 15:54:51 1988
  1563. ***************
  1564. *** 371,376 ****
  1565. --- 371,377 ----
  1566.       F_ellipse    *e;
  1567.       F_spline    *s;
  1568.       F_text        *t;
  1569. +     F_compound    *c1;
  1570.       int        p, q;
  1571.       
  1572.       switch(flip_axis) {
  1573. ***************
  1574. *** 397,400 ****
  1575. --- 398,403 ----
  1576.           flip_spline(s, x, y, flip_axis);
  1577.       for (t = c->texts; t != NULL; t = t->next)
  1578.           flip_text(t, x, y, flip_axis);
  1579. +     for (c1 = c->compounds; c1 != NULL; c1 = c1->next)
  1580. +         flip_compound(c1, x, y, flip_axis);
  1581.       }
  1582. diff -c /tmp/rotate.c rotate.c
  1583. *** /tmp/rotate.c    Fri Aug 26 09:39:24 1988
  1584. --- rotate.c    Thu Aug 25 15:59:51 1988
  1585. ***************
  1586. *** 441,446 ****
  1587. --- 441,447 ----
  1588.       F_ellipse    *e;
  1589.       F_spline    *s;
  1590.       F_text        *t;
  1591. +     F_compound    *c1;
  1592.       int        x1, y1, x2, y2;
  1593.   
  1594.       switch(rotate_angle) {
  1595. ***************
  1596. *** 471,474 ****
  1597. --- 472,477 ----
  1598.           rotate_spline(s, x, y, rotate_angle);
  1599.       for (t = c->texts; t != NULL; t = t->next)
  1600.           rotate_text(t, x, y, rotate_angle);
  1601. +     for (c1 = c->compounds; c1 != NULL; c1 = c1->next)
  1602. +         rotate_compound(c1, x, y, rotate_angle);
  1603.       }
  1604. -- 
  1605. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  1606.